<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style >
      #prize{
        color:red;
        font-size: 40px;
      } 
  </style>
</head>
<body>
    <div id="prize" ></div>
    <button id="btn">抽奖</button>
</body>
<script>
    let prize=document.getElementById("prize")
    let mybtn=document.getElementById("btn");
      let num=0;
    btn.onclick=function(){
   
        let g=chou();
        if(przieArr.length==0){
            prize.innerHTML="今日次数用完"
        }else{
          let prizeObj=g.next();
          g.next();
           prize.innerHTML=prizeObj.value;
        }
      
    }
       let przieArr=["现金5亿","汤臣一品一套","劳斯莱斯一辆","水杯一个"]
    function * chou() {
        let index=Math.floor(Math.random()*przieArr.length);
        yield przieArr[index]
        przieArr.splice(index,1);
    }
</script>
</html>